<script setup lang="ts">
// 绘图渠道
const apisources = useGlobalConfig.Draw.apisources
// 更多设置激活
const activator_moreSettings = ref(false)
const {
  useVideo,
  apisource,
} = storeToRefs(useWorkEditStore())


// TTS渠道配置
const {ttsChannel} = storeToRefs(useWorkEditStore())
const ttsItems = [
  {
    label: '可训练私有声音模型（GPTVits)',
    value: 'GPTVits' as TTSChannel
  },
  {
    label: '最逼真真人发音（ChatTTS）',
    value: 'ChatTTS' as TTSChannel
  },
]
</script>

<template>
  <!--更多设置-->
  <v-btn class="ma-1" size="small" prepend-icon="mdi-dots-horizontal" rounded variant="flat" color="primary" @click="activator_moreSettings = true">
    更多设置
  </v-btn>
  <v-dialog
      v-model="activator_moreSettings"
      max-width="50%">
    <template v-slot:default="{ isActive }">
      <v-card>
        <v-card-title class="d-flex justify-space-between align-center">
          <v-label class="text-h6 font-weight-bold">更多设置</v-label>
          <v-btn
              icon="mdi-close"
              variant="text"
              @click="activator_moreSettings = false"
          ></v-btn>
        </v-card-title>
        <v-card-text>
          <v-sheet class="d-flex justify-space-between align-center">
            <v-label class="text-subtitle-1">绘画渠道选择</v-label>
            <v-chip-group v-model="apisource" filter>
              <v-chip v-for="(item,index) in apisources" :key="index" :value="item.value">{{ item.text }}</v-chip>
            </v-chip-group>
          </v-sheet>
          <v-sheet class="d-flex justify-space-between align-center">
            <v-label class="text-subtitle-1">视频合成资源</v-label>
            <v-switch class="mr-2" color="primary" hide-details densty="compact" v-model="useVideo"
                      :label="useVideo?'使用视频合成':'使用图片合成'"></v-switch>
          </v-sheet>
          <!--                声音合成渠道选择-->
          <v-sheet>
            <v-label class="text-subtitle-1">选择声音合成模型</v-label>
            <v-radio-group
                v-model="ttsChannel"
                inline
            >
              <v-radio v-for="item in ttsItems"
                       :label="item.label"
                       :value="item.value"
              ></v-radio>
            </v-radio-group>

          </v-sheet>

        </v-card-text>
      </v-card>
    </template>
  </v-dialog>
</template>

<style scoped lang="scss">

</style>